﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twi.COMMON.Core;
using Twi.Pages.SCS.BLL;

namespace Twi.Pages.SCS
{
    public class Option
    {
        /// <summary>
        /// 根据选项类别获取选项
        /// </summary>
        /// <param name="optionTypeID"></param>
        /// <returns></returns>
        public TwiReturn GetByOptionTypeID(string optionTypeID)
        {
            TwiReturn twi = new TwiReturn();
            twi.rightName = "pass";
            try
            {
                UserContext.CheckRight(ref twi);
                var list = _Option.Instance.GetByOptionTypeID(optionTypeID);
                twi.totalCount = list.Count;
                twi.data = JSSerialize.Serialize(list);
                twi.success = true;
            }
            catch (System.Exception ex)
            {
                twi.errors = ex.Message;
            }
            return twi;
        }
    }
}
